﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ServiceModel.Description;
using System.ServiceModel.Dispatcher;

namespace ModularAndPlugin.ESB.WCFPlugin.Extensibility
{
    public class ServiceOperationExtensibility : Attribute, IOperationBehavior
    {
        #region IOperationBehavior Members

        public void AddBindingParameters(OperationDescription operationDescription, System.ServiceModel.Channels.BindingParameterCollection bindingParameters)
        {
           
        }

        public void ApplyClientBehavior(OperationDescription operationDescription, ClientOperation clientOperation)
        {
            
        }

        public void ApplyDispatchBehavior(OperationDescription operationDescription, DispatchOperation dispatchOperation)
        {
            ExtensibilityInspector extensibilityInspector = new ExtensibilityInspector(operationDescription.DeclaringContract.ContractType);
            dispatchOperation.ParameterInspectors.Add(extensibilityInspector);
        }

        public void Validate(OperationDescription operationDescription)
        {
            
        }

        #endregion
    }
}